package com.shaolei.basic;

public class BASIC {
	private static final int SETSIZE=1024;
	private static final int IMAGESIZE=360054;
	private static final int IMAGESIZE2=230454;
	private static final int HEADSIZE=12;
	private static final int PKGSIZE=HEADSIZE + SETSIZE;
	private static final int PKGS= (int)Math.ceil((double)IMAGESIZE/(double)SETSIZE);
	public static byte[] combine(byte[] a, byte[] b){
        int length = a.length + b.length;
        byte[] result = new byte[length];
        System.arraycopy(a, 0, result, 0, a.length);
        System.arraycopy(b, 0, result, a.length, b.length);
        return result;
    }
	
	public static byte[] toByteArray(int iSource) {
	    byte[] bLocalArr = new byte[4];
	    for (int i = 0; i < 4; i++) {
	        bLocalArr[i] = (byte) (iSource >> 8 * i & 0xFF);
	    }
	    return bLocalArr;
	}
	public static int toInt(byte[] bRefArr) {
	    int iOutcome = 0;
	    byte bLoop;
	    for (int i = 0; i < bRefArr.length; i++) {
	        bLoop = bRefArr[i];
	        iOutcome += (bLoop & 0xFF) << (8 * i);
	    }
	    return iOutcome;
	}
	public static int get_SETSIZE(){
		return SETSIZE;
	}
	public static int get_IMAGESIZE(){
		return IMAGESIZE;
	}
	public static int get_IMAGESIZE2(){
		return IMAGESIZE2;
	}
	public static int get_PKGSIZE(){
		return PKGSIZE;
	}
	public static int get_HEADSIZE(){
		return HEADSIZE;
	}
	public static int get_PKGS(){
		return PKGS;
	}
}
